<script type="text/javascript"
     src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<head>
    <link rel="stylesheet" href="stylesheet_TMATS.css">
</head>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<title>
    T-MATS: NPSS to TMATS Conversion Tool
</title>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<body>
    <h1>
      T-MATS: NPSS to TMATS Conversion Tool
    </h1>
<hr>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

<p>NPSS to T-MATS automation code. This tool was created using matlab
version R2015aSP1 and NPSS version 2.7.1. </p>
<p>
This tool uses a like for like method to create a T-MATS model directly form a NPSS model.
</p>
---------------------------------------------------------------------------
<br>
<h2>
Running this tool requires the following files:
</h2>
<p>
1) mapplot_matlab.fnc - NPSS map gathering script, this script gathers the
component maps and places them in matlab readable format<br><br>

2) BlockTransMTLB_TMATS.fnc - NPSS T-MATS input gathering script, this script
gathers NPSS variables to be used in T-MATS and places them in a .m script<br><br>

3) AutoLink_TMATS.m - Simulink model generation script, this script generates
a simulink model from the data generated by BlockTransMTLB_TMATS.fnc<br><br>
<h2>
Using the tool:
</h2>
1) Obtain NPSS model to be translated to T-MATS.<br><br>

2) Place both .fnc files so that the NPSS run can find them. In the same
folder as the .run file works.<br><br>

3) Create the folder "Setup_TMATS" in your main NPSS model folder (same folder as the .run file).
Outputs will be placed in this folder.<br><br>

4) Add the following code to the .run file:<br><br>
<code>
/* Add in matlab component map */<br>
#include "mapplot_matlab.fnc"<br>
createMapDataFiles_matlab();</code>
<br><br><code>
/* Gather T-MATS required inputs and linking data */<br>
#include "BlockTransMTLB_TMATS.fnc"<br>
DataFilesMTLB(); </code> <br><br>

5) Run the NPSS model using the its .run script at the model's design point.
This will generate files within the Setup_TMATS folder that include a .m
file for each component map and a .m file for the model call "NameOfModel_Setup.m"<br><br>

6) Run the matlab model setup script to create a workspace variable named
"MWS_NameOfModel".<br><br>

7) To generate the Simulink model run "AutoLink_TMATS.m", calling
the new workspace variable, for example:  "AutoLink_TMATS(MWS_NameOfModel)"<br><br>

8) The simulink model should now be generated. Note, this model should be manually
checked for consistancy and a full block by block validation should occur.
The auto generator will not populate custom blocks and makes many assumptions
about NPSS block inputs. If the NPSS model is not consistant with these assumptions
or the NPSS model has custom components with no T-MATS equivalant, then these portions
of the model will need to be created manually.<br><br>

This tool creates model components but does not apply a solver or other required
model architecture needed for the final dynamic or steady state model.
For details about how the model may be finalized, please see TMATS/TMATS_Examples.
</p>
<br><br>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
</body>